package com.dadaguai.controller;

import com.dadaguai.common.R;
import com.dadaguai.domain.ForumBoard;
import com.dadaguai.service.ForumBoardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/board")
public class ForumBoardController {

    @Autowired
    ForumBoardService forumBoardService;

    /**
     * 获取所有板块
     *
     * @return
     */
    @GetMapping("/boardList")
    public R getBoard() {
        List<ForumBoard> boardList = forumBoardService.getAllBoard();
        return R.success(boardList);
    }


}
